/**
 * 
 */
package com.gosophia.orgManagement.action;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.gosophia.commons.web.action.BaseSupportAction;
import com.gosophia.commons.web.bean.RequestResult;
import com.gosophia.organizationManagement.dto.PositionDTO;
import com.gosophia.organizationManagement.ws.OrganizationManagementWebService;

/**
 * 获取职位用action
 * @author wangxinbing,zhaoyan
 * @since  2010-12-31
 *  Copyright (c) 2010 Gosophia corporation All Rights Reserved
 */
@Controller("GetPositionListAction")
@Scope("prototype")
public class GetPositionListAction extends BaseSupportAction {
    private static final long serialVersionUID = 1L;

    @Autowired
    private OrganizationManagementWebService organizationManagementWebService;
    
    private Long orgId;
    private List<PositionDTO> positionDTOs;
    public String _execute(){
        positionDTOs = organizationManagementWebService.findCertainPositionByOrgId(orgId);
//        if(positionDTOs!=null&&positionDTOs.size()>0){
//            super.getRequestResult().setRsltCode("0");
//            super.getRequestResult().setMessage("正常");
//        }
//        String rsltCode = positionDTOs.size() == 0 ? "1" : "0";
//        String message = rsltCode.equals("0") ? "" : "无数据";
//        super.getRequestResult().setRsltCode(rsltCode);
//        super.getRequestResult().setMessage(message);
//        //this.setRequestResult(requestResult);
        return SUCCESS;
    }

    public List<PositionDTO> getPositionDTOs() {
        return positionDTOs;
    }

    public void setPositionDTOs(List<PositionDTO> positionDTOs) {
        this.positionDTOs = positionDTOs;
    }

    public Long getOrgId() {
        return orgId;
    }

    public void setOrgId(Long orgId) {
        this.orgId = orgId;
    }

//    @Override
//    public RequestResult getRequestResult() {
//        return requestResult;
//    }
    
}
